package com.caojing.syby.ui.brandsale;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by My on 2016/10/5.
 */
public class BrandFragmentVpAdapter extends FragmentPagerAdapter {


    private List<Fragment> mFragmentList;
    private String[] tabName;
    public BrandFragmentVpAdapter(FragmentManager fm,String[] tabName,List<Fragment> mFragmentList) {
        super(fm);
        this.tabName=tabName;
        this.mFragmentList=mFragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabName[position];
    }
}
